<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>基本选择器</title>
    <script src="../js/jquery-1.8.3.min.js"></script>
    <script src="../js/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="div1">div1</div>
<div class="cls">div2</div>
<div class="cls">div3</div>
</body>
<script>
    //元素选择器  $("元素名称") 标签名称
    let divs = $("div");
    alert(divs.length);
    //id选择器
    let div1=$("#div1");
    alert(div1.text());
    //类选择器
    let cls=$(".cls");
    $(".cls").each(function (i,ele) {
        alert(i+":"+ele.innerHTML)
    })
</script>
</html>